<template>
  <div>
    <to-back :title="'秒杀活动列表'" @update-page="updatePage"></to-back>
    <div class="box-da">
      <div class="box">
        <div class="box1">
          <div class="box1_zuo">
            <i class="el-icon-search"></i>
            筛选查询
          </div>
          <div class="box1_you">
            <div class="box1_shai">
              <i :class="shrinks ? 'el-icon-arrow-up ' : ' el-icon-arrow-down '" @click="shrink()"></i>
              <span v-text="!shrinks ? '展开筛选' : '收起筛选'"></span>
            </div>
            <div class="box1_you1">查询结果</div>
          </div>
        </div>
        <div class="box2" :style="'height : ' + fllheight">
          <div>
            <span>活动名称：</span>
            <el-input type="text" placeholder="活动名称" class="box2_input" />
          </div>
        </div>
      </div>
      <div>
        <item-list></item-list>
      </div>
    </div>
  </div>
</template>

<script>
import itemList from '../../../components/ItemList.vue'
export default {
  components: {
    itemList
  },
  data() {
    return {
      shrinks: false
    }
  },
  computed: {
    fllheight() {
      if (this.shrinks) {
        return '60px'
      }
      return '0'
    }
  },
  methods: {
    updatePage() {
      console.log('父组件收到了')
    },
    shrink() {
      this.shrinks = !this.shrinks
      console.log(this.shrinks)
    }
  }
}
</script>

<style lang="less" scoped>
.box-da {
  margin: 30px 20px 0 20px;
  height: 1000px;
  .box {
    border: 1px solid #ccc;
  }
  .box1 {
    box-sizing: border-box;
    padding: 0 20px;
    height: 50px;
    line-height: 50px;
    background-color: rgba(243, 243, 243, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    .box1_you {
      display: flex;
      align-items: center;
      .box1_shai {
        margin-right: 15px;
      }
      .box1_you1 {
        top: 50%;
        width: 80px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        border: 1px solid #ccc;
      }
    }
  }
  .box2 {
    overflow: hidden;
    margin-left: 40px;
    height: 60px;
    display: flex;
    align-items: center;
    .box2_input {
      box-sizing: border-box;
      width: 180px;
      height: 35px;
      padding-left: 10px;
    }
  }
}
</style>
